<template>
<div>
   <div class="g_top_box">
		<div class="g_right_box"></div> 
		<div class="g_left_box"><h4>公司信息</h4></div>
	</div>
	<div class="g_content_box">

		<Form :model="info" label-position="left" :label-width="100">
			<FormItem label="名称">
				<Input v-model="info.name" style="width:200px;"></Input>
			</FormItem>
			<FormItem label="联系人">
				<Input v-model="info.contacts" style="width:200px;"></Input>
			</FormItem>
			<FormItem label="联系电话">
				<Input v-model="info.tel" style="width:200px;"></Input>
			</FormItem>
			<FormItem label="地址">
				<Input v-model="info.address" style="width:200px;"></Input>
			</FormItem>
			<FormItem label="公司资金">
				<InputNumber :min="0" :max="10000000000" v-model="info.money" style="width:200px;"></InputNumber>
			</FormItem>
			
			<FormItem>
				<Button type="primary" @click="save">修改</Button>
			</FormItem>
		</Form>

		
	</div>
</div>
</template>

<script>
import Wcore from '@/libs/common';
export default {
    name: 'company_info',
    data (){
		
        return {
            info:{
				name:'',
				contacts:'',
				tel:'',
				address:'',
				money:0
			},
			id:0,
        };
    },
	created(){
		this.id = this.$route.params.id;
		this.load_data();
		
		this.$emit('change','company');
	},
    computed: {
       
    },
	methods:{
		load_data(){
			var self = this;
			var postdata = {
				id:this.id
			};
			Whttp.load('User/Company/get_info',postdata,function(result){
				result['money'] = parseFloat(result['money']);
				self.info = result;
				
			});
		},
		save(){
			var self = this;
			var postdata = this.info;
			postdata['id'] = this.id;
			
			
			Whttp.load('User/Company/save',postdata,function(result){
				self.$Message.info('保存成功');
				self.$router.back();
			});
		},
		
	}
};
</script>
<style scoped>

</style>